package day09API.string;

import java.util.Random;
import java.util.Scanner;

public class Test03 {

    public static void main(String[] args) {
        String s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        Random r = new Random();
        char[] c = new char[4] ;
        for (int i = 0; i < 4; i++) {
            c[i] = s.charAt(r.nextInt(s.length()));
        }
        String s1 = new String(c);
        System.out.println(s1);

        Scanner sc = new Scanner(System.in);
        if (sc.nextLine().trim().equalsIgnoreCase(s1)) {
//            sc.nextLine().trim().equalsIgnoreCase(s1);
//            sc.nextLine().trim().toLowerCase().equals(s1.toLowerCase())
            System.out.println("验证成功");
        }else {
            System.out.println("验证失败");
        }

    }

}
